home *** CD-ROM | disk | FTP | other *** search
/ Palm Utilities / Palm_Utilities_CD-ROM_2001_2001.iso / files / internet misc / XML PalmPilot applications 1.0 / XTPP-latest.exe / Pilot / pilotdump.xst < prev    next >
Encoding:
Text File  |  1999-12-17  |  5.9 KB  |  187 lines

  1. <XST Filename='pilotdump.xst'
  2.      Description='Output entire address database from Pilot database to HTML or Plaintext'
  3.      Author='David Ball/Philip Allen'
  4.      Version='2.0'
  5.      Date='8 April 1999'
  6.      Copyright='&copy; 1999 DecisionSoft Limited'
  7.      XMLscript='1.0'
  8.      Ref='pilotdump'
  9.      debug=''
  10.      __maxCR="2"
  11. ><_if test=" \ENV\REQUEST_METHOD.__exists" >Content-type: text/html
  12.  
  13. </_if>
  14.  
  15. <!--
  16.     We need the "Content-type: text/html" to be on the first output line
  17.     followed by two carriage returns, if we're running in cgi
  18.  
  19.     Note the 'double backslash' used instead of the single backslash.  Always 
  20.     use double backslash when describing DOS/Windows directory paths.
  21. -->
  22.  
  23. <!--    
  24.     YOU NEED TO CONFIGURE THESE
  25. -->
  26.     # $\.appsRoot := "..\\pilot\\" #
  27.     # $\.datName := "sample.dat" #
  28.  
  29.  
  30. <_if test=" \ENV\REQUEST_METHOD.__exists" >
  31.     <then> # $\.context := "cgi" # </then>
  32.     <else> # $\.context := "cmdline" # </else>
  33. </_if>
  34.  
  35. <_if>
  36.     # $\.fileOut := "1" !! Set context to cgi for this !! #
  37.     # $\.context := "cgi" #
  38. </_if>
  39.  
  40. <!--
  41.     Set global attributes
  42. -->
  43.  
  44. # $.cellColor := "yellow" #
  45. # $.mainColor := "lightblue" #
  46.  
  47. <!--
  48.     Define the system command
  49. -->
  50.  
  51. # $\.cmd := $\.appsRoot 'loadbook ' $\.appsRoot $\.datName #
  52. # $\.sysCmd := $\.cmd '>  c:\\temp\\CGItmp.txt' #
  53.  
  54. <!--
  55.     The system command is piped to file to make it work with httpd.
  56. -->
  57.  
  58. <_eval result="data">
  59. <_filter find='\#' replace='' >
  60.     <Pilot>
  61.         <_system command="# $\.sysCmd #"/>
  62.         <_echo file="c:\temp\CGItmp.txt" />
  63.     </Pilot>
  64. </_filter>
  65. </_eval>
  66.  
  67. <_if>
  68.     Debug information: incoming data -# \Pilot #-
  69. </_if>
  70.  
  71. <!--
  72.     Define the template we're going to run
  73. -->
  74.  
  75. <_template name="DisplayHTML">
  76.     <HTML>
  77.     <HEAD>
  78.     <TITLE>XML address display</TITLE>
  79.     </HEAD>
  80.     <BODY BGCOLOR="ffffff">
  81.     <CENTER>
  82.     <TABLE CELLPADDING="10" CELLSPACING="0">
  83.         <TR>
  84.             <TD ALIGN="left" VALIGN="top" COLSPAN="5">
  85.                 <IMG SRC="images/xmlscript.jpg" ALT="XML Script" />
  86.             </TD>
  87.         </TR>
  88.         <TR BGCOLOR="#$.mainColor#">
  89.             <TD><STRONG>ID</STRONG></TD>
  90.             <TD><STRONG>Status</STRONG></TD>
  91.             <TD><STRONG>Position</STRONG></TD>
  92.             <TD><STRONG>Name</STRONG></TD>
  93.             <TD><STRONG>Title</STRONG></TD>
  94.             <TD><STRONG>Company</STRONG></TD>
  95.             <TD><STRONG>Address</STRONG></TD>
  96.             <TD><STRONG>Email</STRONG></TD>
  97.             <TD><STRONG>Work</STRONG></TD>
  98.             <TD><STRONG>Home</STRONG></TD>
  99.             <TD><STRONG>Fax</STRONG></TD>
  100.             <TD><STRONG>Pager</STRONG></TD>
  101.             <TD><STRONG>Note</STRONG></TD>
  102.             <TD><STRONG>Private</STRONG></TD>
  103.             <TD><STRONG>Category</STRONG></TD>
  104.             <TD><STRONG>DisplayPhone</STRONG></TD>
  105.             <TD><STRONG>c1</STRONG></TD>
  106.             <TD><STRONG>c2_w0__</STRONG></TD>
  107.             <TD><STRONG>c3</STRONG></TD>
  108.             <TD><STRONG>c4</STRONG></TD>
  109.         </TR>
  110.  
  111. <_foreach object="AddressRecord">
  112.         <TR BGCOLOR="#$.mainColor#">
  113.             <TD BGCOLOR="#$.cellColor#">#.ID#<_if test="not(.ID)">None</_if></TD>
  114.             <TD BGCOLOR="#$.cellColor#">#.Status#</TD>
  115.             <TD BGCOLOR="#$.cellColor#">#.Position#<_if test="not(.Position)">None</_if></TD>
  116.             <TD BGCOLOR="#$.cellColor#">#FirstName# #LastName#<_if test="not(FirstName) and not(LastName)">None
  117.                                                                     </_if></TD>
  118.             <TD BGCOLOR="#$.cellColor#">#Title#<_if test="not(Title)">None</_if></TD>
  119.             <TD BGCOLOR="#$.cellColor#">#Company#<_if test="not(Company)">None</_if></TD>
  120.             <TD BGCOLOR="#$.cellColor#">#Address# #City# #State# #ZipCode# #Country#<_if test="not(Address) and 
  121.                                 not(City) and not(State) and not(ZipCode) and not(Country)">None</_if></TD>
  122.             <TD BGCOLOR="#$.cellColor#"><A HREF="#'mailto:' Email#">#Email#</A><_if test="not(Email)">None</_if></TD>
  123.             <TD BGCOLOR="#$.cellColor#">#Phone#<_if test="not(Phone)">None</_if></TD>
  124.             <TD BGCOLOR="#$.cellColor#">#Home#<_if test="not(Home)">None</_if></TD>
  125.             <TD BGCOLOR="#$.cellColor#">#Fax#<_if test="not(Fax)">None</_if></TD>
  126.             <TD BGCOLOR="#$.cellColor#">#Pager#<_if test="not(Pager)">None</_if></TD>
  127.             <TD BGCOLOR="#$.cellColor#">#Note#<_if test="not(Note)">None</_if></TD>
  128.             <TD BGCOLOR="#$.cellColor#">#Private#</TD>
  129.             <TD BGCOLOR="#$.cellColor#">#Category#<_if test="not(Category)">None</_if></TD>
  130.             <TD BGCOLOR="#$.cellColor#">#DisplayPhone#<_if test="not(DisplayPhone)">None</_if></TD>
  131.             <TD BGCOLOR="#$.cellColor#">#c1#<_if test="not(c1)">None</_if></TD>
  132.             <TD BGCOLOR="#$.cellColor#">#c2_w0__#<_if test="not(c2_w0__)">None</_if></TD>
  133.             <TD BGCOLOR="#$.cellColor#">#c3#<_if test="not(c3)">None</_if></TD>
  134.             <TD BGCOLOR="#$.cellColor#">#c4#<_if test="not(c4)">None</_if></TD>
  135.         </TR>
  136. </_foreach>
  137.     </TABLE>
  138.     </CENTER>
  139.     </BODY>
  140.     </HTML>
  141. </_template>
  142.  
  143. <_template name="DisplayPlain">
  144.  
  145. XML Contact Display
  146.  
  147. <_foreach object="AddressRecord">
  148. -----------------------------------------
  149. <_if test=".ID">ID:           #.ID#
  150. </_if>Status:       #.Status#
  151. <_if test=".Position">Position:     #.Position#
  152. </_if><_if test="(FirstName) or (LastName)">Name:         #FirstName# #LastName#
  153. </_if><_if test="Title">Title:        #Title#
  154. </_if><_if test="Company">Company:      #Company#
  155. </_if><_if test="(Address) or (City) or (State) or (ZipCode) or (Country)">Address:      #Address# #City# #State# #ZipCode# #Country#
  156. </_if><_if test="Email">Email:        #Email#
  157. </_if><_if test="Phone">Work:         #Phone#
  158. </_if><_if test="Home">Home:         #Home#
  159. </_if><_if test="Fax">Fax:          #Fax#
  160. </_if><_if test="Pager">Pager:        #Pager#
  161. </_if><_if test="Note">Note:         #Note#
  162. </_if>Private:      #Private#
  163. <_if test="Category">Category:     #Category#
  164. </_if><_if test="DisplayPhone">DisplayPhone: #DisplayPhone#
  165. </_if><_if test="c1">c1:           #c1#
  166. </_if><_if test="c2_w0__">c2_w0__:      #c2_w0__#
  167. </_if><_if test="c3">c3:           #c3#
  168. </_if><_if test="c4">c4:           #c4#
  169. </_if></_foreach>
  170.  
  171. </_template>
  172.  
  173. <!--
  174.     Tie the template to the data
  175. -->
  176.  
  177. <_method object="Pilot" template="DisplayHTML" context="cgi" />
  178. <_method object="Pilot" template="DisplayPlain" context="cmdline" />
  179.  
  180. <!--    
  181.     Process the data
  182. -->
  183.  
  184. <_process object="\Pilot" />
  185.  
  186. </XST>
  187.